# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=ptlib
pkgver=2.10.11
pkgrel=7
pkgdesc="Portable Windows Library"
arch=('i686' 'x86_64')
url="http://www.opalvoip.org"
license=('GPL')
depends=('sdl' 'libpulse' 'v4l-utils' 'libldap')
replaces=('pwlib')
conflicts=('pwlib')
source=(http://downloads.sourceforge.net/opalvoip/ptlib-$pkgver.tar.bz2
        ptlib-2.10.11-bison_fixes-2.patch
        disable-sslv3.patch
        openssl-1.1.0.patch)
sha256sums=('27a8ba1fd147195c0b310897f81d26f73996b77b18147e587638444cfacd681a'
            '733f97ae7ceeb11e65882e56dd605decdfaa6c83418fd6c582f9fdedca924b3f'
            '6a290d636d24138282762a5a53a8c92bd1760261fcdda155b825b9d62c30fdb1'
            '815143893de1f9c558c4dda048066992283d619a1c685a1c078ff915bd7f0d86')

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../ptlib-2.10.11-bison_fixes-2.patch
  patch -Np1 -i ../disable-sslv3.patch
  patch -Np1 -i ../openssl-1.1.0.patch
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --libdir=/usr/lib \
      --sysconfdir=/etc --localstatedir=/var \
      --enable-opal --enable-plugins \
      --enable-oss --enable-v4l2 \
      --disable-avc --enable-sdl \
      --enable-ipv6 --enable-v4l \
      --disable-dc --disable-odbc \
      --enable-expat --enable-httpforms
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install
}
